createNavigationButton.js ➔ createNavigationButton   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
nop 2
1
/**
2
 * @param image
3
 * @param container
4
 * @returns {Element}
5
 */
6
export function createNavigationButton(image, container) {
7
    let control = container.querySelector('.gmnoprint.gm-bundled-control.gm-bundled-control-on-bottom > .gmnoprint:first-child > div');
8
    let navigation = document.createElement('div');
9
10
    navigation.setAttribute('class', 'maps-editor__add-marker-container');
11
    navigation.innerHTML = `
12
        <div class="maps-editor__add-marker-subcontainer">
13
            <img src="${image}" draggable="false" class="maps-editor__add-new-marker" />
14
        </div>
15
    `;
16
17
    let separator = document.createElement('div');
18
19
    separator.setAttribute('class', 'maps-editor__separator');
20
21
    control.prepend(navigation);
22
    navigation.parentNode.insertBefore(separator, navigation.nextSibling);
23
24
    return navigation;
25
}